<template>
    <div class="index-container">
        <!-- 导航栏 -->
        <indexNavBar
                :title="$route.meta.title"
                :back="false"
                @click-left="$router.go(-1)"
        ></indexNavBar>
        <div style="margin-top: 20px"></div>
        <div class="vant-table">
            <table cellspacing="0" style="width:100%" class="table">
                <tr>
                    <th class="th" v-for="(item, index) in tableColumn" :key="index">{{ item.label }}</th>
                </tr>
                <tr v-for="(item, index) in tableData" :key="index" class="list-tr">
                    <td>{{ item.accountName }}</td>
                    <td>￥{{ item.amount }}</td>
                    <td @click="goBindCarList(item)" style="color: #1ECFEA">{{ item.vehicleCount }}</td>
                </tr>
            </table>
        </div>
        <div class="noMore">没有更多内容了</div>
    </div>
</template>

<script>
import indexNavBar from '@/components/style/index-nav-bar.vue'
import setting from './setting'
export default {
    name: 'FundList',
    components: {
        indexNavBar
    },
    data () {
        return {
            tableData: [],
            tableColumn: setting.column,
            bgcolor: '#1ECFEA'
        }
    },
    created () {
        this.getFundList()
        console.log(this.tableColumn)
    },
    mounted () {},
    methods: {
        /** 资金账户列表*/
        async getFundList () {
            let _ = this
            try {
                _.$U.showLoading(_)
                const res = await _.$H.get(_, _.$A.fund.accountInfo, {})
                this.tableData = res.data.accountEntities
                _.$U.hideLoading(_)
            } catch (e) {
                _.$U.hideLoading(_)
            }
        },
        /* */
        goBindCarList (item) {
            this.$router.push({ name: 'bindCarList', query: { accountId: item.accountId }})
        }
    }

}
</script>

<style lang="less" scoped>
.vant-table {
    .table {
        .th {
            font-size: 14px;
            font-family: Helvetica, Helvetica-Regular;
            font-weight: 400;
            color: #2d3748;
            height: 38px;
            line-height: 38px;
            background-color: #f5f9f9;
            text-align: center;
        }
        .list-tr {
            width: 60px;
            height: 40px;
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Medium;
            font-weight: 500;
            text-align: center;
            color: #2d3748;
            line-height: 17px;
        }
    }
}
.noMore {
    margin: 0 auto;
    width: 84px;
    height: 40px;
    opacity: 0.4;
    font-size: 12px;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 500;
    text-align: right;
    color: #2d3748;
    line-height: 40px;
}
</style>
